package oop_05.homework_01;

public class animalTest {


    public static void main(String[] args) {
//        Cat cat = new Cat("花花",40);
//        Dog dog = new Dog("外挂",60);
//        Eagle eagle = new Eagle("天天",50);
        Animal animal;
        animal = new Cat("花花",40);
        animal.eat();
        animal.cry();
        if (animal instanceof Cat){
            Cat cat = (Cat)animal;
            cat.catchMouse();
        }
        else if (animal instanceof Dog){
            Dog dog = (Dog)animal;
            dog.lookHouse();
        }
        else if (animal instanceof Eagle){
            Eagle eagle = (Eagle)animal;
            eagle.hunt();
        }

    }
}
